var shiquan = {
	initContent:function(){
		localStorage.setItem("shiquan.contentlist","[]");
	},
	getContentList:function(){
		var list = localStorage.getItem("shiquan.contentlist")||"[]";
		return JSON.parse(list);
	},
	addContent:function(content){
		var list = shiquan.getContentList();
		for (var i= list.length -1; i>=0; i--) {
			if(list[i].link == content.link)
				list.splice(i,1);
		}
		list.push(content);
		localStorage.setItem("shiquan.contentlist",JSON.stringify(list));
		return list;
	},
	delContent:function(content){
		var list = shiquan.getContentList();
		for (var i= list.length-1; i>=0; i--) {
			//console.log(JSON.stringify(list[i]));
			//console.log("content="+JSON.stringify(content));
			//console.log(list[i].link == content.link);
			if(list[i].link == content.link)
				list.splice(i,1);
		}
		localStorage.setItem("shiquan.contentlist",JSON.stringify(list));
		return list;
	},
};
